import 'package:auto_route/annotations.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
import 'package:sonora/models/sj_broad_caster_data.dart';
import 'package:sonora/views/article/sj_article_detail_page.dart';
import 'package:sonora/views/article/sj_article_publish_page.dart';
import 'package:sonora/views/navigation/routes/sj_auth_guard.dart';
import 'package:sonora/views/sj_about_page.dart';
import 'package:sonora/views/sj_coin_shop_page.dart';
import 'package:sonora/views/sj_edit_page.dart';
import 'package:sonora/views/sj_follow_list_page.dart';
import 'package:sonora/views/sj_home_page.dart';
import 'package:sonora/views/sj_login_page.dart';
import 'package:sonora/views/sj_main_screen.dart';
import 'package:sonora/views/sj_medal_page.dart';
import 'package:sonora/views/sj_medal_store_page.dart';
import 'package:sonora/views/sj_mine_page.dart';
import 'package:sonora/views/sj_onboarding_page.dart';
import 'package:sonora/views/sj_other_profile_page.dart';
import 'package:sonora/views/sj_setting_page.dart';
import 'package:sonora/views/sj_video_page.dart';
import 'package:sonora/views/sj_block_list_page.dart';
import 'package:sonora/views/sj_webview_page.dart';

import '../../../models/sj_works_model.dart';

part 'sj_app_router.gr.dart';

@AutoRouterConfig()
class SjAppRouter extends _$SjAppRouter {
  final SjAuthGuard authGuard;

  SjAppRouter({required this.authGuard}) : super();

  @override
  RouteType get defaultRouteType => const RouteType.adaptive();

  @override
  List<AutoRoute> get routes => [
        AutoRoute(page: SjOnboardingRoute.page),
        AutoRoute(page: SjLoginRoute.page),
        AutoRoute(page: SjMainRoute.page, initial: true, guards: [
          authGuard
        ], children: [
          AutoRoute(page: SjHomeRoute.page),
          AutoRoute(page: SjVideoRoute.page),
          AutoRoute(page: SjMedalRoute.page),
          AutoRoute(page: SjMineRoute.page),
        ]),
        AutoRoute(page: SjOtherProfileRoute.page),
        AutoRoute(page: SjFollowListRoute.page),
        AutoRoute(page: SjBlockListRoute.page),
        AutoRoute(page: SjAboutRoute.page),
        AutoRoute(page: SjSettingRoute.page),
        AutoRoute(page: SjEditRoute.page),
        AutoRoute(page: SjCoinShopRoute.page),
        AutoRoute(page: SjMedalStoreRoute.page),
        AutoRoute(page: SjArticlePublishRoute.page),
        AutoRoute(page: SjArticleDetailRoute.page),
        AutoRoute(page: SjWebviewRoute.page),
      ];
}
